directly print error only if there is more than one job in the queue
authordgellow <samuel.elborai@gmail.com>
Fri, 27 Jan 2017 20:44:48 +0000 (21:44 +0100)
committerdgellow <samuel.elborai@gmail.com>
Fri, 27 Jan 2017 20:44:52 +0000 (21:44 +0100)
src/cargo/ops/cargo_rustc/job_queue.rs

index e7a242c55173c1dc5bb8aab3fb6c341b14ac5c87..7a380851eee2c9cbf2750831fb6fef279383e307 100644 (file)
@@ -182,15 +182,15 @@ impl<'a> JobQueue<'a> {
                     match result {
                         Ok(()) => self.finish(key, cx)?,
                         Err(e) => {
-                            handle_error(&*e, &mut *cx.config.shell());
-
                             if self.active > 0 {
+                                error = Some(human("build failed"));
+                                handle_error(&*e, &mut *cx.config.shell());
                                 cx.config.shell().say(
                                             "Build failed, waiting for other \
                                              jobs to finish...", YELLOW)?;
                             }
                             if error.is_none() {
-                                error = Some(human("build failed"));
+                                error = Some(e);
                             }
                         }
                     }